package com.buddies.lottery.exception;

/**
 * 自定义的异常类型
 * Created by liuleigang on 2018/3/23.
 */

public class DefineException extends Throwable {

    public enum ExceptionType {
        TYPE_DEFAULT,                        // 默认类型
        TYPE_EMPTY,                          // 输入数据为空
        TYPE_WRONG_INPUT                     // 输入数据有误
    }

    private ExceptionType exceptionType;

    public DefineException(String msg) {
        this(ExceptionType.TYPE_DEFAULT, msg);
    }

    public DefineException(ExceptionType type, String msg) {
        super(msg);
        this.exceptionType = type;
    }

    public ExceptionType getType() {
        return exceptionType;
    }
}
